<?php


// 搜索参数
$_GET['keyword']	= empty($_GET['keyword']) ? '' : trim($_GET['keyword']);
$_GET['pid']		= empty($_GET['pid']) ? 0 : intval($_GET['pid']);
$_GET['depth']		= empty($_GET['depth']) ? 0 : intval($_GET['depth']);

$oMenu = new Menu();
$list = null;
if(empty($_GET['keyword']) && empty($_GET['pid']) && empty($_GET['depth'])){
	$menus = cache_read('menus.php');
	$list = $menus['menu_list'];
}
if(empty($list)){
	$list = $oMenu->get_menu_list($_GET['pid'], $_GET['keyword'], 0, $_GET['depth']);
}

if(!empty($list)){
	foreach($list as $key => $row){
		$row['name'] = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $row['level']).$__l[$row['name']];
		$row['power'] = $oMenu->formatPower_out($row['power'], true);
		$row['target'] = Statics::$target_arr[$row['target']];
		$row['addtime'] = ftime($row['addtime']);
		$row['updatetime'] = ftime($row['updatetime']);
		$list[$key] = $row;
	}
	$vars['list'] = $list;
	$vars['total'] = count($list);
}
?>